<template>
  <span>
  </span>
</template>

<script>
import { mapActions } from "vuex";
export default {
  name: 'DeviceLoader',
  props: {
    deviceCode: String
  },
  computed: {
  },
  created () {
    if (this.deviceCode) {
      this.loadDevice({ deviceNo: this.deviceCode, deviceFlag: 1 });
    }
  },
  methods: {
    ...mapActions({ loadDevice: 'device/load' })
  },
  watch: {
    deviceCode (deviceCode) {
      this.loadDevice({ deviceNo: deviceCode, deviceFlag: 1 })
    }
  },
}
</script>